package org.wmq.skyserver.mapper;

import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.wmq.skycommon.annotation.AutoFill;
import org.wmq.skycommon.enumeration.OperationType;
import org.wmq.skycommon.pojo.entity.Employee;

@Mapper
public interface EmployeeMapper {
    @Insert("insert into employee(name, username, password, phone, sex, id_number, create_time, update_time, create_user, update_user) " +
            "values(#{name},#{username},#{password},#{phone},#{sex},#{idNumber},#{createTime},#{updateTime},#{createUser},#{updateUser})")
    @AutoFill(OperationType.INSERT)
    public abstract void insert(Employee employee);


    public abstract Page<Employee> pageQuery(String name);

    @AutoFill(OperationType.UPDATE)
    public abstract void update(Employee employee);

    @Select("select * from employee where id = #{id}")
    public abstract Employee selectById(Long id);
}
